package com.SSM.controller;

import com.SSM.pojo.About;
import com.SSM.service.AboutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class HelloWorldController {

    @Autowired
    @Qualifier("aboutServiceImpl")
    private AboutService aboutService;

    @RequestMapping("/start")
    public String start(){

        return "start";
    }


    @RequestMapping("/about")
    public String helloWorld(Model model){
        List<About> all = aboutService.getAll();
        model.addAttribute("list",all);
        return "about";
    }

}
